package com.cheyun.netsalev3.view

import android.content.Intent
import com.cheyun.netsalev3.R
import com.cheyun.netsalev3.databinding.ActivitySetBinding
import com.cheyun.netsalev3.utils.BaseActivity
import com.cheyun.netsalev3.utils.FunctionUtils
import com.cheyun.netsalev3.utils.MySharedPreferences

class SetActivity : BaseActivity<ActivitySetBinding>() {
    override fun initContentView(): Int {
        return R.layout.activity_set
    }

    override fun initView() {
        binding.newBut.setOnClickListener {
            startActivity(Intent(this, NewsSetActivity::class.java))
        }
        binding.switchBut.setOnClickListener {
            startActivity(Intent(this, WorkSwitchActivity::class.java))
        }
        binding.loginOut.setOnClickListener {
            MySharedPreferences.clearAll()
            var intent = Intent(this, LoginActivity::class.java)
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
            startActivity(intent)
            MyToast("退出成功")
        }
        binding.txtVersion.setText("版本号 v"+FunctionUtils.getCurrentVersion(this))
//        binding.txtPhone.setText("工作号 (尚未开通，请联系管理员)")
//        MySharedPreferences.getLoginData()?.member?.phoneX?.apply {
//            binding.txtPhone.setText("工作号 "+this)
//        }
    }

    override fun initData() {
    }


}
